<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../Include/inc.asp" -->
<!--#include file="../Include/Conn.asp" -->
<!--#include file="../Include/Function.asp" -->
<!--#include file="seeion.asp"-->
<% call chkAdmin("|2") %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" id="css" href="images/style.css">
<title>附加参数设置</title>
</head>
<body>
<%Select Case request.QueryString("Action")
Case "SaveConst"
SaveConstInfo
End Select%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <td height="30" class="topnav"><div>静态功能管理</div></td>
  </tr>
  <tr>
  <td bgcolor="#FFFFFF">
<form name="ConstForm" method="post" action="?Action=SaveConst">
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0" class="stable">
  
    <tr onmouseover="style.backgroundColor='#EEEEEE'" onmouseout="style.backgroundColor='#FFFFFF'" bgcolor="#FFFFFF">
      <td width="16%"  align="right"class="td">系统安装目录：</td>
      <td width="84%" class="td"><input name="dir" type="text" class="inp" id="dir" style="width:150px" value="<%=dir%>" readonly="readonly">
        <font color="red">*</font></td>
    </tr>
	<tr onmouseover="style.backgroundColor='#EEEEEE'" onmouseout="style.backgroundColor='#FFFFFF'" bgcolor="#FFFFFF">
      <td width="16%"  align="right"class="td">手机站安装目录：</td>
      <td width="84%" class="td"><input name="mdir" type="text" class="inp" id="mdir" style="width:150px" value="<%=mdir%>">
        <font color="red">*</font></td>
    </tr>
    <tr>
      <td class="td" align="right">是否开启系统静态功能：</td>
      <td class="td">
      <label class="inp"><input name="html" type="radio" value="1" <%if html = 1 then%> checked<%end if%>>不启用</label>
    </tr>
	<tr>
      <td class="td" align="right">生成静态页面后缀：</td>
      <td class="td"><select name="HTMLName" class="sel" style="width: 80">
          <option value="html" <%if HTMLName="html" then response.write "selected"%>>html</option>
          <option value="htm" <%if HTMLName="htm" then response.write "selected"%>>htm</option>
          <option value="shtml" <%if HTMLName="shtml" then response.write "selected"%>>shtml</option>
        </select>
        <font color="red">*</font> 如：New.html中“html”即为后缀。可设置如：html、htm、shtml、asp</td>
    </tr>
	<tr>
      <td class="td" align="right">分类页生成前缀：</td>
      <td class="td"><input name="Clas" type="text" class="inp" id="Clas" style="width: 150px" value="<%=Clas%>">
        <font color="red">*</font> 如：Class_1.html中“Class”即为前缀</td>
    </tr>
    <tr>
      <td class="td" align="right">详细页生成前缀：</td>
      <td class="td"><input name="Show" type="text" class="inp" id="ShowCase" style="width:150px" value="<%=Show%>">
        <font color="red">*</font> 如：Show_1.html中“Show”即为前缀</td>
    </tr>
    <tr>
      <td class="td" align="right">所有分页生成分隔：</td>
      <td class="td"><input name="fy" type="text" class="inp" id="fy" style="width: 150px" value="<%=fy%>">
        <font color="red">*</font></td>
    </tr>
      <td class="td" align="right">分隔符：</td>
      <td class="td"><input name="Separated" type="text" class="inp" id="Separated" style="width:80px" value="<%=Separated%>">
        <font color="red">*</font> 如：New-1.html中的“-”即为分隔符</td>
    </tr>
  </table>
<div class="topnav"><div>网站显示设置</div></div>
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0" class="stable">
	<tr onmouseover="style.backgroundColor='#EEEEEE'" onmouseout="style.backgroundColor='#FFFFFF'" bgcolor="#FFFFFF">
	  <td align="right" class="td">百度地图坐标</td>
	  <td  class="td"><input name="ditu_Coordinate" type="text" class="inp"  style="color:#FF0000;width:150px" value="<%=ditu_Coordinate%>" />        
	    [<a href="http://api.map.baidu.com/lbsapi/getpoint/index.html" target="_blank"  style="color:#003399; ">获取地图坐标</a>] * 注：获取的106.510742,29.542198</td>
	  </tr>
	  <tr onmouseover="style.backgroundColor='#EEEEEE'" onmouseout="style.backgroundColor='#FFFFFF'" bgcolor="#FFFFFF">
        <td align="right" class="td">联系我们地图名称</td>
        <td class="td"><input name="ditu_mc" type="text" class="inp" style="width:350px" value="<%=ditu_mc%>" /></td>
      </tr>
	  <tr onmouseover="style.backgroundColor='#EEEEEE'" onmouseout="style.backgroundColor='#FFFFFF'" bgcolor="#FFFFFF">
        <td  align="right" class="td">联系我们地图说明</td>
        <td  class="td"><textarea name="ditu_sm" cols="50" class="tex" style="width:350px"><%=ditu_sm%></textarea></td>
	  </tr>
        <tr>
        <td height="25" align="right" class="td">是否开放注册</td>
        <td bgcolor="#F1F5F8" class="td"><label class="inp"><input type="radio" name="userzc" value="0" <%if userzc=0 then%>checked<%end if%> />开放</label>
     <label class="inp"> <input type="radio" name="userzc" value="1" <%if userzc=1 then%>checked<%end if%> />关闭</label></td>
      </tr>
	  
       <tr>
        <td height="25" align="right" class="td">会员注册审核</td>
        <td  class="td"><label class="inp"><input type="radio" name="usersh" value="0" <%if usersh=0 then%>checked<%end if%> />需要</label>
            <label class="inp"><input type="radio" name="usersh" value="1" <%if usersh=1 then%>checked<%end if%> />不需</label>
          </td>
      </tr>
       
      <tr>
        <td height="25" align="right" class="td">留言是否审核</td>
        <td bgcolor="#F1F5F8" class="td">
          <label class="inp"><input type="radio" name="booksh" value="0" <%if booksh=0 then%>checked<%end if%> />需要</label>
          <label class="inp"><input type="radio" name="booksh" value="1" <%if booksh=1 then%>checked<%end if%> />不需</label></td>
      </tr>

	<tr>
      <td class="td" align="right">频道页显示友情链接</td>
      <td class="td"><label class="inp"><input name="link" type="radio" value="0" <%if link = 0 then%> checked<%end if%>>显示</label>
        <label class="inp"><input name="link" type="radio" value="1" <%if link = 1 then%> checked<%end if%>>不显</label></td>
    </tr>
	
	<tr>
      <td class="td" align="right">后台登陆是否开启验证码</td>
      <td class="td"><label class="inp"><input name="code" type="radio" value="0" <%if code = 0 then%> checked<%end if%>>开启</label>
     <label class="inp"> <input name="code" type="radio" value="1" <%if code = 1 then%> checked<%end if%>>关闭</label></td>
    </tr>
	<tr>
        <td width="16%" height="13" align="right" class="td">网站客服功能是否开启</td>
        <td width="84%"  class="td"><label class="inp"><input name="qqkf" type="radio" value="0" <%if qqkf = 0 then%> checked<%end if%>>开启</label>
         <label class="inp"><input name="qqkf" type="radio" value="1" <%if qqkf = 1 then%> checked<%end if%>>关闭</label></td>
      </tr>
	  	<tr>
      <td class="td" align="right">是否开启网站分享功能</td>
      <td class="td"><label class="inp"><input name="share" type="radio" value="0" onClick="Date1.style.display=''" <%if share = 0 then%> checked<%end if%>>开启</label>
                     <label class="inp"><input name="share" type="radio" value="1" onClick="Date1.style.display='none'" <%if share = 1 then%> checked<%end if%>>关闭</label></td>
    </tr>
   <tr>
    <td class="td" align="right">是否开启二维码显示</td>
    <td class="td"><label class="inp"><input name="zych_rwmon" type="radio" value="0"  onClick="Date3.style.display=''" <%if zych_rwmon= 0 then%> checked<%end if%>>显示</label>
                   <label class="inp"><input name="zych_rwmon" type="radio" value="1" onClick="Date3.style.display='none'" <%if zych_rwmon= 1 then%> checked<%end if%>>不显</label>
                   
  <table width="100" border="0" cellspacing="0" cellpadding="0" id="Date3" style="display:<%If zych_rwmon<>0 Then Response.Write "none"%>">
        <tr>
            <td><input name="zych_rwmurl" type="text" class="inp"  value="<%=zych_rwmurl%>" size="40" /></td>
            <td><iframe src="up.asp?formname=ConstForm&inputname=zych_rwmurl&uploadstyle=file" frameborder="0" scrolling="no" width="300" height="28"></iframe></td>
          </tr>
      </table></td>
  </tr>

<tr>
   <td class="topnav"><div>网站运营设置</div></td>
   <td class="topnav"></td>
</tr>
<tr >
<td width="16%" height="13" align="right" class="td">是否开启在线(支付)购物功能：</td>
<td width="84%"  class="td">
    <label class="inp"><input name="pay" type="radio" value="1" <%if pay=1 then%> checked<%end if%>>关闭</label>免费版不支持</td>
</tr>
<tr>
<td align="right" class="td">支付宝接口类型</td>
<td class="td"><select name="alipayLX" class="sel">
        <option value="Guarantee" <%if alipayLX="Guarantee" then%>selected<%end if%>>双功能收款</option>
        <option value="Immediate" <%if alipayLX="Immediate" then%>selected<%end if%> >即时到账收款</option>
     	 </select></td>
</tr>
<tr>
<td align="right" class="td">收款支付宝帐号</td>
<td class="td"><input name="alipayID" type="text" disabled="disabled" class="inp" value="<%=alipayID%>" /></td>
</tr>
<tr>
<td align="right" class="td">合作者身份(PID)</td>
<td class="td"><input name="alipayPID" type="text" disabled="disabled" class="inp" value="<%=alipayPID%>" /> 
仅支持"担保交易或即时到账"双功能接口 <a href="https://b.alipay.com/order/productSet.htm" target="_blank">没有点击申请</a></td>
</tr>
<tr>
<td align="right" class="td">安全校验码(Key)</td>
<td class="td"><input name="alipayKey" type="text" disabled="disabled" class="inp" value="<%=alipayKey%>" size="50" /></td>
</tr>
<tr>
<td align="right" class="td">快递查询接口Key</td>
<td class="td"><input name="kdappKey" type="text" disabled="disabled" class="inp" value="<%=kdappKey%>" size="50" /> 没有接口码，在这里申请：<a href="http://www.kuaidi.com/openapi.html">http://www.kuaidi.com/openapi.html</a></td>
</tr>
<tr>
<td align="right" class="td">百度主动推送Token</td>
<td class="td"><input name="Token" type="text" disabled="disabled" class="inp" value="<%=Token%>" size="50" /> 没有token，需要在百度站长平台添加网站后，在这里获取：<a href="http://zhanzhang.baidu.com/site/siteadd">http://zhanzhang.baidu.com/site/siteadd</a></td>
</tr>

    <tr>
      <td class="td" align="right">&nbsp;</td>
      <td class="td"><input name="submitSaveEdit" type="submit" id="submitSaveEdit" class="btn" value="保存附加参数设置"></td>
    </tr>
</table>
</form>
</td>
  </tr>
</table>
<%
Function SaveConstInfo()
    Set ASM = server.CreateObject("Adod" & "b.St" & "ream")
    ASM.Type = 2
    ASM.mode = 3
    ASM.charset = "utf-8"
    ASM.Open
    ASM.WriteText "<" & "%" & vbCrLf
    ASM.WriteText "Const html = " & ReplaceConstChar(Trim(request("html")))&""& vbCrLf
	ASM.WriteText "Const mdir = " & Chr(34) & ReplaceConstChar(Trim(request("mdir"))) & Chr(34) &"" & vbCrLf
    ASM.WriteText "Const HTMLName = " & Chr(34) & ReplaceConstChar(Trim(request("HTMLName"))) & Chr(34) & "" & vbCrLf
	ASM.WriteText "Const Clas = " & Chr(34) & ReplaceConstChar(Trim(request("Clas"))) & Chr(34) & "" & vbCrLf
	ASM.WriteText "Const Show = " & Chr(34) & ReplaceConstChar(Trim(request("Show"))) & Chr(34) & "" & vbCrLf
    ASM.WriteText "Const fy = " & Chr(34) & ReplaceConstChar(Trim(request("fy"))) & Chr(34) & "" & vbCrLf
    ASM.WriteText "Const Separated = " & Chr(34) & ReplaceConstChar(Trim(request("Separated"))) & Chr(34) & "" & vbCrLf
	ASM.WriteText "Const link = " & ReplaceConstChar(Trim(request("link"))) & "" & vbCrLf
    ASM.WriteText "Const ditu_Coordinate = " & Chr(34) & ReplaceConstChar(Trim(request("ditu_Coordinate")))& Chr(34) & "" & vbCrLf
    ASM.WriteText "Const ditu_mc = " & Chr(34) & ReplaceConstChar(Trim(request("ditu_mc"))) & Chr(34) & "" & vbCrLf
    ASM.WriteText "Const ditu_sm = " & Chr(34) & ReplaceConstChar(Trim(request("ditu_sm"))) & Chr(34) & "" & vbCrLf
	ASM.WriteText "Const code = " & ReplaceConstChar(Trim(request("code"))) &"" & vbCrLf
	ASM.WriteText "Const qqkf = " & ReplaceConstChar(Trim(request("qqkf"))) &"" & vbCrLf
	ASM.WriteText "Const share = " & ReplaceConstChar(Trim(request("share"))) &"" & vbCrLf
    ASM.WriteText "Const sharefx = " & Chr(34) & ReplaceConstChar(Trim(request("sharefx"))) & Chr(34) & "" & vbCrLf
	ASM.WriteText "Const userzc = " & ReplaceConstChar(Trim(request("userzc"))) &"" & vbCrLf 
	ASM.WriteText "Const usersh = " & ReplaceConstChar(Trim(request("usersh"))) &"" & vbCrLf 
	ASM.WriteText "Const booksh = " & ReplaceConstChar(Trim(request("booksh"))) &"" & vbCrLf 
	ASM.WriteText "Const zych_rwmon = " & Chr(34) & ReplaceConstChar(Trim(request("zych_rwmon"))) & Chr(34) & "" & vbCrLf
	ASM.WriteText "Const zych_rwmurl = " & Chr(34) & ReplaceConstChar(Trim(request("zych_rwmurl"))) & Chr(34) & "" & vbCrLf 

	ASM.WriteText "Const pay= " & ReplaceConstChar(Trim(request("pay"))) &"" & vbCrLf 
	ASM.WriteText "Const alipayLX = " & Chr(34) & ReplaceConstChar(Trim(request("alipayLX"))) & Chr(34) & "" & vbCrLf
	ASM.WriteText "Const alipayID = " & Chr(34) & ReplaceConstChar(Trim(request("alipayID"))) & Chr(34) & "" & vbCrLf
	ASM.WriteText "Const alipayPID = " & Chr(34) & ReplaceConstChar(Trim(request("alipayPID"))) & Chr(34) & "" & vbCrLf
	ASM.WriteText "Const alipayKey = " & Chr(34) & ReplaceConstChar(Trim(request("alipayKey"))) & Chr(34) & "" & vbCrLf
	ASM.WriteText "Const kdappKey = " & Chr(34) & ReplaceConstChar(Trim(request("kdappKey"))) & Chr(34) & "" & vbCrLf
	ASM.WriteText "Const Token = " & Chr(34) & ReplaceConstChar(Trim(request("Token"))) & Chr(34) & "" & vbCrLf
    ASM.WriteText "%" & ">"
    ASM.SaveToFile Server.mappath("../Include/inc.asp"), 2
    ASM.flush
    ASM.Close
    Set ASM = Nothing
    If ReplaceConstChar(Trim(request("HTML"))) = 1 and request.form("delok")= 1 Then Call FsoDelHtml(ReplaceConstChar(Trim(request("HTMLName"))))
    response.Write "<script language=""javascript"">alert('系统附加参数生成成功');location.href='admin_SetSite.asp';</script>"
End Function
'=================================================
'删除静态
'=================================================
Sub FsoDelHtml(HTMLName)
    Dim Fso, FsoOut, File
    Set Fso = Server.CreateObject("Scripting.FileSystemObject")
    Set FsoOut = Fso.GetFolder(Server.Mappath(""&Dir&""))
	For Each File In FsoOut.Files
        If Right(File.Name, Len(File.Name) - InStrRev(File.Name, ".")) = HTMLName And HTMLName <> "asp" Then
            Response.Write "<span style=""color:red; padding-left: 18px"">" & File.Name & "</span> 成功删除…<br />"
            Fso.DeleteFile File.Path, True
        End If
    Next
	htmlml="Type,Show" 
	htmlml=split(htmlml,",") 
	for i=0 to ubound(htmlml) 
		Set FsoOut = Fso.GetFolder(Server.Mappath(""&Dir&htmlml(i)&""))
		For Each File In FsoOut.Files
			If Right(File.Name, Len(File.Name) - InStrRev(File.Name, ".")) = HTMLName And HTMLName <> "asp" Then
				Response.Write "<span style=""color:red; padding-left: 18px"">"&htmlml(i)&"/"&File.Name&"</span> 成功删除…<br />"
				Fso.DeleteFile File.Path, True
			End If
		Next
	next 
	
	Set rst= Server.CreateObject("ADODB.Recordset")
	menu="select * from [zych_Type] where isok=1 and menu=1 and ParentID=0 order by px_id asc"'选择分类
	rst.Open menu,Conn,1,1
	if rst.bof and rst.eof then 
	Response.Write""
	else
	do while not rst.eof
	    HTMLML=rst("Sorthtml")
	    if HTMLML<>"Type" and  HTMLML<>"Show" then
		Set Fso=server.createobject("scripting.filesystemobject") 
		if Fso.FolderExists(Server.MapPath(""&Dir&HTMLML&"")) then 
		'删除目录
		     Response.Write "<span style=""color:red;line-height:30px;padding-left:18px"">"&Dir&HTMLML&"</span> 目录下所有静态页成功删除…<br />"
		     Fso.DeleteFolder(Server.MapPath(""&Dir&HTMLML&""))
		Else
		Response.Write""
		End If
		Set FsoOut = Nothing
		end if
	rst.MoveNext
	Loop
	end if
	rst.close
	set rst=nothing

    Set FsoOut = Nothing
    Set Fso = Nothing
End Sub

Function ReplaceConstChar(strChar)
    If strChar = "" Or IsNull(strChar) Then
        ReplaceConstChar = ""
        Exit Function
    End If
    Dim strBadChar, arrBadChar, tempChar, i
    strBadChar = "+,',%,^,&,?,(,),<,>,[,],{,},;,:," & Chr(34) & "," & Chr(0) & ",--"
    arrBadChar = Split(strBadChar, ",")
    tempChar = strChar
    For i = 0 To UBound(arrBadChar)
        tempChar = Replace(tempChar, arrBadChar(i), "")
    Next
    tempChar = Replace(tempChar, "@@", "@")
    ReplaceConstChar = tempChar
End Function
%>
